/*
 * @Author: zhangweinan
 * @Date: 2022-11-16 09:45:46
 * @LastEditors: zhangweinan
 * @LastEditTime: 2023-04-26 10:33:20
 * @Description: file content
 * @FilePath: \front-end-of-task-center\src\api\bpm\definition.js
 */
import request from '@/utils/request'

export function getProcessDefinitionPage(query) {
  return request({
    url: '/bpm/process-definition/page',
    method: 'get',
    params: query
  })
}

export function getProcessDefinitionList(query) {
  return request({
    url: '/bpm/process-definition/list',
    method: 'get',
    params: query
  })
}

export function getProcessDefinitionBpmnXML(id) {
  return request({
    url: '/bpm/process-definition/get-bpmn-xml?id=' + id,
    method: 'get'
  })
}

//创建发布url
export function createProcessShareUrl(data) {
  return request({
    url: '/act/process_share_url/create',
    method: 'post',
    data
  })
}
//url链接验证
export function validateProcessUrl(shareCode) {
  return request({
    headers: {
      'tenant-id': 1
    },
    url: `/act/process_share_url/validate/${shareCode}`,
    method: 'get'
  })
}

export function getAllOnLine() {
  return request({
    url: `/act/model-version/getAllOnLine`,
    method: 'get'
  })
}
//流程发布列表
export function getProcessUrlList(data) {
  return request({
    url: `/act/process_share_url/queryPage`,
    method: 'post',
    data
  })
}
//删除已经发布的流程
export function deleteProcessUrl(id) {
  return request({
    url: `/act/process_share_url/delete/${id}`,
    method: 'delete',
  })
}
